{include file="header.html"}
<script type="text/javascript">
    $(function () {
        $('#ad_form').validate({
            errorPlacement: function (error, element) {
                $(element).next('.field_notice').hide();
                $(element).after(error);
            },
            success: function (label) {
                label.addClass('right').text('OK!');
            },
            onkeyup: false,
            rules: {
                {if !$ad.ad_pic}
                ad_pic: {
                    required: true,
                    accept: 'gif|png|jpe?g'
                },
                {/if}
                ad_name: {
                    required: true,
                }
            },
            messages: {
                {if !$ad.ad_pic}
                ad_pic: {
                    required: '{$lang.ad_logo_empty}',
                    accept: '{$lang.limit_img}'
                },
                {/if}
                ad_name: {
                    required: '{$lang.ad_name_empty}',
                }
            }
        });
    });
</script>
<div id="rightTop">
    <p>广告管理</p>
    <ul class="subnav">
        <li><a class="btn1" href="index.php?app=advertisement_setting">{$lang.manage}</a></li>
        <li><span>{$lang.edit}</span></li>
    </ul>
</div>

<div class="info">
    <form method="post" enctype="multipart/form-data" id="banner_form">
        <table class="infoTable">
            <tr>
                <th class="paddingT15">
                    标题:</th>
                <td class="paddingT15 wordSpacing5" >
                    <input class="infoTableFile2" id="advertisement_title" name="advertisement_title" value="{$info.advertisement_title}"/>
                    <input type="hidden" name="advertisement_id" value="{$info.advertisement_id}">

                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    链接:</th>
                <td class="paddingT15 wordSpacing5" >
                    <input class="infoTableFile2" id="advertisement_link" name="advertisement_link" value="{$info.advertisement_link}"/>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    选择图片:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableFile2" id="advertisement_url" type="file" name="advertisement_url" />
                </td>
            </tr>
            {if $info.advertisement_url}
            <tr>
                <th class="paddingT15">
                </th>
                <td class="paddingT15 wordSpacing5">
                    <img src="{$info.advertisement_url}?{$random_number}" class="makesmall" max_width="120" max_height="90" />
                </td>
            </tr>
            {/if}
            <tr>
                <th class="paddingT15">
                    类型:</th>
                <td class="paddingT15 wordSpacing5" >
                    <select name="type">
                        <option value="0">{$lang.select_pls}</option>
                        {html_options options=$typeList selected=$info.type}
                    </select>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    出现位置:</th>
                <td class="paddingT15 wordSpacing5" >
                    <select name="type_id">
                        <option value="0">{$lang.select_pls}</option>
                        {html_options options=$typeIDList selected=$info.type_id}
                    </select>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    选择主题:</th>
                <td class="paddingT15 wordSpacing5" >
                    <select name="theme_id">
                        <option value="0">{$lang.select_pls}</option>
                        {html_options options=$theme selected=$info.theme_id}
                    </select>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    是否关闭:</th>
                <td class="paddingT15 wordSpacing5" >
                    <select name="closed">
                        <option value="0">{$lang.select_pls}</option>
                        {html_options options=$closeList selected=$info.closed}
                    </select>
                </td>
            </tr>
            <tr>
                <th></th>
                <td class="ptb20">
                    <input class="formbtn" type="submit" name="Submit" value="{$lang.submit}" />
                    <input class="formbtn" type="reset" name="Submit2" value="{$lang.reset}" />
                </td>
            </tr>
        </table>
    </form>
        <div class = "bg-model" style="position:absolute;top:0%;left:0%;display:none;background:rgba(0,0,0,0.3);width:100%;height:100%;position:fixed;z-index:9999">
            <iframe src="index.php?app=goods&act=iframe" id="goods_page" width="90%" height="90%"></iframe>
        </div>

</div>
{include file="footer.html"}
<script>

</script>
